package ch6;

public class Cat extends Animal {
    private double weight;
    private  String breed;

    public Cat(String name, double vit, double weight, String breed) {
        super(name, vit);
        this.weight = weight;
        this.breed = breed;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
    public String getBreed() {
        return breed;
    }

    public void setBreed(String breed) {
        this.breed = breed;
    }

    public void show(){
        System.out.println("这个猫的品种是："+this.getBreed());
        super.show();

    }
    public void ate(Mouse m){
        this.setVit(this.getVit()+m.getVit());
        m.setVit(0);
        System.out.println("猫吃了老鼠，他们的体力发生了变化。");
        System.out.println("猫的体力是："+this.getVit()+"\n老鼠的体力是："+m.getVit());
    }
}
